<template>
  <div class="nation">
    <el-checkbox-group
      v-model="model.relationshipList"
      @change="handlerCheckBox"
    >
      <el-checkbox label="0">本人</el-checkbox>
      <el-checkbox label="1">配偶</el-checkbox>
      <el-checkbox label="2">子</el-checkbox>
      <el-checkbox label="3">女</el-checkbox>
      <el-checkbox label="38">儿媳</el-checkbox>
      <el-checkbox label="4">孙子、孙女或外孙子、外孙女</el-checkbox>
      <el-checkbox label="5">父母</el-checkbox>
      <el-checkbox label="6">祖父母或外祖父母</el-checkbox>
      <el-checkbox label="7">兄弟姐妹</el-checkbox>
      <el-checkbox label="9">其他</el-checkbox>
      <el-input v-model="model.relationshipValue" style="width:120px" />
    </el-checkbox-group>
  </div>
</template>

<script>
export default {
  props: {
    model: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {}
  },
  methods: {
    handlerCheckBox(value) {
      if (this.model.relationshipList.length > 1) {
        this.model.relationshipList.splice(0, 1)
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.nation {
  // display: flex;
  .el-input {
    margin-left: 15px;
  }
}
</style>
